import data from "../../../../core/cache_data";
import Utils from "../../../../core/utils";
import Bullet from "../../bullet";
import World from "../../world";
import { WorldData } from "../../world_data";

export class BulletGameUtils {
    static InstantiateBullet<T extends Bullet>(bulletPrefabName: string, com: new () => T) {
        return <T>cc.instantiate(Utils.loader.getAsset<cc.Prefab>(bulletPrefabName, "bullets", "cc.Prefab")).getComponent(com);
    }

    static InstantiateWorld(worldPrefab: string = "") {
        worldPrefab = worldPrefab || "world";
        let world = cc.instantiate(Utils.loader.getAsset<cc.Prefab>(worldPrefab, "worlds", "cc.Prefab")).getComponent(World);
        return world;
    }
}; 